package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.pojo.SysMenu;
import com.zhentao.service.SysMenuService;
import com.zhentao.mapper.SysMenuMapper;
import com.zhentao.vo.Limit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author cyz
* @description 针对表【sys_menu(菜单表)】的数据库操作Service实现
* @createDate 2025-07-01 08:15:36
*/
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
    implements SysMenuService{
    @Autowired
    private SysMenuMapper sysMenuMapper;
    @Override
    public Page<SysMenu> findPage(Limit limit) {
        Page<SysMenu>page = new Page<>(limit.getStart(),limit.getEnd());
        QueryWrapper<SysMenu>queryWrapper = new QueryWrapper<>();
        queryWrapper.like(limit.getTitle()!=null,"title",limit.getTitle());
        sysMenuMapper.selectPage(page,queryWrapper);
        return page;
    }
}




